open(BUFF,"out_beagle_dosage2genotype_out") or die "no file exists\n";
open(BUFF1,"out_impute_dosage2genotype_out") or die "no file2 exists\n";
while(<BUFF>)
{
	$line = <BUFF1>;
	chomp($_);
	chomp($line);
	@array = split(" ",$_);
	@array1 = split(" ",$line);
	if($array[0] eq $array1[0])
	{
		print "$array[0]";
		$n = 0;
		for($i = 1;$i<@array;$i++)
		{
			$val1 = $array[$i];
			$val3 = $array1[$i];
			$i++;	
			$val2 = $array[$i];
			$val4 = $array1[$i];
			if(($val1 eq $val3 && $val2 eq $val4)||($val1 eq $val4 && $val2 eq $val3))
			{
				$n++;
			}
		}
		print " $n\n";
	}
}
